package com.example.nophase.Fragment;

import android.content.Context;
import android.content.Intent;
import android.graphics.Color;
import android.os.Bundle;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.Button;
import android.widget.FrameLayout;

import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
import androidx.fragment.app.Fragment;

import com.example.nophase.R;
import com.example.nophase.activity.staff.ApplyForListActivity;
import com.example.nophase.activity.staff.ProjectActivity;
import com.example.nophase.activity.staff.StaffMainTaskListActivity;
import com.example.nophase.activity.staff.TaskFromActivity;

import java.time.Instant;

public class StaffMainHomeContentFragment extends Fragment {

    public Context context;
    private StaffMainHomeContentFragment(Context context) {
        this.context = context;
    }

    public static StaffMainHomeContentFragment newInstance(Context context) {
        StaffMainHomeContentFragment fragment = new StaffMainHomeContentFragment(context);
        return fragment;
    }

    @Nullable
    @Override
    public View onCreateView(@NonNull LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) {
        View view = inflater.inflate(R.layout.staff_home_fragment_content, container, false);
        Button button1 = view.findViewById(R.id.btn_1);
        Button button2 = view.findViewById(R.id.btn_2);
        Button button3 = view.findViewById(R.id.btn_3);
        button1.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                Intent intent = new Intent(context, ApplyForListActivity.class);
                intent.putExtra("code","已完成");
                context.startActivity(intent);

            }
        });

        button2.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                Intent intent = new Intent(context, ApplyForListActivity.class);
                intent.putExtra("code","审核中");
                context.startActivity(intent);
            }
        });

        button3.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                startActivity(new Intent(context, StaffMainTaskListActivity.class));

            }
        });
        return view;
    }
}
